package com.alibaba.citrus.ots.sales.plan.facade.service.setting.contract;

import com.alibaba.citrus.ots.common.annotation.FacadeInvoker;
import com.alibaba.citrus.ots.sales.plan.api.setting.contract.DepartmentContractRedLineQueryService;
import com.alibaba.citrus.ots.sales.plan.dto.api.request.DepartRedLineQueryRequest;
import com.alibaba.citrus.ots.sales.plan.repository.DepartmentContractRedLineRepository;
import com.alibaba.citrus.ots.sales.plan.sdo.DepartmentContractRedLineSDO;
import com.alibaba.cz.base.tool.result.Result;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author wangyibing
 */
@Component
public class DepartContractRedLineQueryServiceImpl implements DepartmentContractRedLineQueryService {
    @Resource
    private DepartmentContractRedLineRepository departmentContractRedLineRepository;

    @Override
    @FacadeInvoker
    public Result<DepartmentContractRedLineSDO> getDepartRedLineDetail(DepartRedLineQueryRequest departRedLineQueryRequest) {
        DepartmentContractRedLineSDO departmentContractRedLineSDO = departmentContractRedLineRepository.querySingleByDepartAndItem(departRedLineQueryRequest);
        return Result.success(departmentContractRedLineSDO);
    }
}
